#include <iostream>
using namespace std;
int n, k, l, r;
int a[105];
int main(){
	cin >> n >> k;
	for (int i = 1; i <= n; i++)cin >> a[i];
	while(k--){
		cin >> l >> r;
		int ans = 0;
		int sum = 0;
		for (int i = l; i <= r; i++){
			sum++;
			if (sum % 2 == 0){
				ans += 2 * a[i];
			}
			else ans += a[i];
		}
		cout << ans << endl;
	}

    return 0;
}


